package aex.service;



import java.io.Serializable;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import aex.dao.MessageBoardDao;
import aex.domain.MessageBoard;



@Transactional(readOnly = false)
@Service(MessageBoardService.SERVICE_NAME)

public class MessageBoardService  {

	
	public static final String SERVICE_NAME="aex.service.MessageBoardService";
	/**
	 * 以注解的形式让spring为我们注入dao的实现类
	 */
	@Resource(name = MessageBoardDao.SERVICE_NAME)
	public MessageBoardDao dao;
	
	public MessageBoardService() {
		
	}
	public MessageBoard findByID(Serializable id) {
		return dao.findObjectByID(Integer.parseInt(id+""));
	}
	public void deleteById(Serializable id) {
		dao.deleteObjectByIDs(Integer.parseInt(id+""));
	}
	public void save(MessageBoard obj) {
		dao.save(obj);
	}
	public void update(MessageBoard obj) {
		dao.merge(obj);
	}
}
